package com.iman.Confucius.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import org.springframework.stereotype.Service;

import com.iman.Confucius.service.ClassManageService;
import com.iman.Confucius.vo.teacher.ClassListVO;
import com.iman.Confucius.vo.teacher.NewStudentsVO;
import com.iman.common.hibernate.HibernateSupport;
import com.iman.common.hibernate.TemplateQLService;

@Service
public class ClassManageServiceImpl implements ClassManageService {
	@Inject
	HibernateSupport hibernateSupport;

	@Inject
	TemplateQLService templateQLService;

	@Override
	public List<ClassListVO> getTeacherClass(Long id) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", id);
		List<ClassListVO> result = templateQLService.findBySQLBeanQuery(
				"get_class_list", params, ClassListVO.class);
		return result;
	}

	@Override
	public List<NewStudentsVO> getNewStudentList(Long id) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", id);
		List<NewStudentsVO> result = templateQLService.findBySQLBeanQuery(
				"get_new_student_list", params, NewStudentsVO.class);
		return result;
	}

	@Override
	public List<NewStudentsVO> getStudentByClass(Long id) {
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("id", id);
		List<NewStudentsVO> result = templateQLService.findBySQLBeanQuery(
				"get_student_byclass", params, NewStudentsVO.class);
		return result;
	}

}
